package tools;
import java.util.Scanner;

public class TrainCrashTime{
    public float crashTime(){
        Scanner scan = new Scanner(System.in);
        
        System.out.print("第一辆列车速度 km/h: ");
        int train01 = scan.nextInt();
        System.out.print("第二辆列车速度 km/h: ");
        int train02 = scan.nextInt();
        System.out.print("两车相距 km: ");
        int distance = scan.nextInt();
        
        return (float)(distance/(train01 + train02));
    }
}